package cn.darkhorse.meswechat.common;

import java.net.URL;

/**
 * @description:
 * @author: mr.wang
 * @time: 2023/4/14 14:31
 */
public class WxChatAddress {
	
	
	/**
	 * token 地址
	 * @return
	 */
	public static String getToken(){
		String address = String.format(WxChatCommon.WX_URL + "/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", WxChatCommon.APP_ID, WxChatCommon.SECRET);
		return address;
	}
	
	/**
	 * 获取ticket
	 * @return
	 */
	public static String getTicket(String token){
		String address = String.format(WxChatCommon.WX_URL +"/cgi-bin/qrcode/create?access_token=%s",token);
		return address;
	}
	
	/**
	 * 获取二维码
	 * @return
	 */
	public static String getQRCode(String ticket){
		String address = String.format("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=%s",ticket);
		return address;
	}
	
	public static String sendMessage(String token){
		String address = String.format("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=%s",token);
		return address;
	}





}
